package filter.v0;


import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * Created by Administrator on 2022/10/20.
 */
public class Application {

    public static void main(String[] args) {
        List<Person> persons = new ArrayList<Person>();

        persons.add(new Person("Robert","Male", "Single"));
        persons.add(new Person("John","Male", "Married"));
        persons.add(new Person("Laura","Female", "Married"));
        persons.add(new Person("Diana","Female", "Single"));
        persons.add(new Person("Mike","Male", "Single"));
        persons.add(new Person("Bobby","Male", "Single"));


        List<Person> malePersons=new ArrayList<>();
        for(Person person:persons){
            if(person.getGender().trim().equalsIgnoreCase("MALE")){
                malePersons.add(person);
            }
        }
    }
}
